﻿using System;
using UniRx;
using UniRx.Triggers;
using UnityEngine;

namespace Studio
{
	// Token: 0x020004AF RID: 1199
	[AddComponentMenu("Studio/Manager/Input Field", 1000)]
	public class InputFieldManager : Singleton<InputFieldManager>
	{
		// Token: 0x17000337 RID: 823
		// (set) Token: 0x06001E09 RID: 7689 RVA: 0x000BE98C File Offset: 0x000BCB8C
		public static StudioInputField studioInputField
		{
			set
			{
				if (Singleton<InputFieldManager>.IsInstance())
				{
					Singleton<InputFieldManager>.Instance.m_StudioInputField = value;
					Singleton<InputFieldManager>.Instance.enabled = (value != null);
				}
			}
		}

		// Token: 0x17000338 RID: 824
		// (get) Token: 0x06001E0A RID: 7690 RVA: 0x000BE9B4 File Offset: 0x000BCBB4
		public static bool isFocused
		{
			get
			{
				return Singleton<InputFieldManager>.IsInstance() && Singleton<InputFieldManager>.Instance.m_StudioInputField && Singleton<InputFieldManager>.Instance.m_StudioInputField.isFocused;
			}
		}

		// Token: 0x06001E0B RID: 7691 RVA: 0x000BE9F0 File Offset: 0x000BCBF0
		protected override void Awake()
		{
			if (!base.CheckInstance())
			{
				return;
			}
			UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
			InputFieldManager.studioInputField = null;
			(from _ in this.UpdateAsObservable()
			where this.m_StudioInputField && this.m_StudioInputField.isFocused && Input.anyKey && !Input.GetMouseButton(0)
			select _).Subscribe(delegate(Unit _)
			{
				Input.ResetInputAxes();
			});
		}

		// Token: 0x04002087 RID: 8327
		private StudioInputField m_StudioInputField;
	}
}
